<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1 id="time"></h1>
<hr>
<input type="button" value="开始" id="start" onclick="startTime()">
<input type="button" value="暂停" id="end" disabled="disabled" onclick="endTime()">
</body>
</html>
<script type="text/javascript">
    var count = 0;
    function startTime() {
        count = window.setInterval(function () {
            var date = new Date();
            document.getElementById("time").innerText = date.toLocaleString();
        },1000)
        document.getElementById("start").disabled=true;
        document.getElementById("end").disabled=false;
    }

    function endTime() {
        window.clearInterval(count);
        document.getElementById("start").disabled=false;
        document.getElementById("end").disabled=true;
    }

</script>